  function showModalWindow(smw_url, smw_width, smw_height){
    var mwc = $('#modal-window-container');
    mwc
      .empty()
      .html('<div class="close-button">Close</div><div id="modal-window"><div class="loading-animator"></div></div>')
      .show();
    $('#modal-window').animate({'width':smw_width+'px','height':smw_height+'px', marginTop:'-='+((smw_height/2) - 30)+'px',marginLeft:'-='+((smw_width/2) - 30)+'px'}, 600, function(){
      $.ajax({
        url: smw_url,
        error:function (xhr, ajaxOptions, thrownError){
          $('#modal-window').empty().html('<div class="error-message">'+xhr.statusText+'</div>');
        },
        success: function(html){
          $('#modal-window').empty().html(html);
        },
        complete: function(){
          mwc.find('div.close-button')
          .css({'margin-top':'-'+((smw_height/2) + 21)+'px', 'margin-left':((smw_width/2) - 115)+'px'})
          .slideDown()
          .click(function(){
            mwc.empty().hide();
          });
        }
      });

    });
  }
  
  function setupLabel() {
    if ($('.label_check input').length) {
        $('.label_check').removeClass('c_on');
        $('.label_check input:checked').each(function(){ 
            $(this).parent('label').addClass('c_on');
        });                
    };
    if ($('.label_radio input').length) {
        $('.label_radio').removeClass('r_on');
        $('.label_radio input:checked').each(function(){ 
            $(this).parent('label').addClass('r_on');
        });
    };
}
